package com.ymatou.iapi.login.testcase;

import java.util.Date;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.login.parameter.AliUserRequestDtoBean;
import com.ymatou.iapi.login.service.AliUserRequestDtoCall;
import com.ymatou.iapi.userservice.parameter.enums.AppSourceEnum;
import com.ymatou.iapi.userservice.parameter.enums.TerminalSourceEnum;
import com.ymatou.iapi.userservice.parameter.enums.ThirdPartyTypeEnum;
import com.ymatou.iapi.userservice.parameter.req.BindThirdPartyUserReq;
import com.ymatou.iapi.userservice.parameter.req.CreateUserReq;
import com.ymatou.iapi.userservice.parameter.req.UnBindThirdPartyUserReq;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P3;
import com.ymttest.business.service.JUserCallService;
import com.ymttest.database.model.ThirdpartyUserbind;
import com.ymttest.database.model.ThirdpartyUserbindHistory;
import com.ymttest.database.mongo.UserTokenWapper;
import com.ymttest.database.sqlwapper.JUserWapper;
import com.ymttest.database.sqlwapper.YmtUsersWapper;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.constant.AppTypeChannel;
import com.ymttest.utils.constant.ECode;
/**
*创建QQ用户接口
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_AliUserRequestDto{
	private static AliUserRequestDtoBean aliuserregbean;
	private static AliUserRequestDtoCall aliuserregCall;
	private static YmtUsersWapper userWapper; 
	private static UserTokenWapper userTokenWapper;
	
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("创建QQ用户接口");
	}

	@Before
	public void caseUp() throws Exception {
		aliuserregbean=new AliUserRequestDtoBean();
		aliuserregCall=new AliUserRequestDtoCall();
		userWapper = new YmtUsersWapper();
		userTokenWapper = new UserTokenWapper();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(aliuserregCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	private void verifyDBBind(Integer uid, AliUserRequestDtoBean cq) {
		//TODO 需要检查字段
		JUserWapper ju=new JUserWapper();
		
		Logger.comment("验证thirdparty_userbind");
		ThirdpartyUserbind thirdinfo = ju.selectthirdpartyuserbind(uid).get(0);
		Logger.verifyEquals(cq.getSAliUserId(), thirdinfo.getThirdPartyId(), "验证ThirdPartyId");
		Logger.verifyEquals(ThirdPartyTypeEnum.Alipay.getCode(), thirdinfo.getThirdPartyType(), "验证ThirdPartyType");
	}
	private void verifyDB(Integer uid, AliUserRequestDtoBean cq) {
		//TODO 需要检查字段
		JUserWapper ju=new JUserWapper();
		
		Logger.comment("验证thirdparty_userbind");
		ThirdpartyUserbind thirdinfo = ju.selectthirdpartyuserbind(uid).get(0);
		Logger.verifyEquals(cq.getSAliUserId(), thirdinfo.getThirdPartyId(), "验证ThirdPartyId");
		Logger.verifyEquals(ThirdPartyTypeEnum.Alipay.getCode(), thirdinfo.getThirdPartyType(), "验证ThirdPartyType");
		
		Logger.comment("验证thirdparty_userbind_history");
		ThirdpartyUserbindHistory thirdinfohist = ju.selectthirdpartyuserbindhistory(uid).get(0);
		Logger.verifyEquals(true, thirdinfohist.getBinding(), "验证binding状态");
		Logger.verifyEquals(cq.getRegSource().getCode(), thirdinfohist.getAppSource(), "验证AppSource");
		Logger.verifyEquals(cq.getClientIp(), thirdinfohist.getClientIp(), "验证ClientIp");
		Logger.verifyEquals(cq.getDeviceId(), thirdinfohist.getDeviceId(), "验证DeviceId");
		Logger.verifyEquals(cq.getSEmail(), thirdinfohist.getEmail(), "验证Email");
		Logger.verifyEquals(cq.getEquimentid(), thirdinfohist.getEquimentid(), "验证Equimentid");
		Logger.verifyEquals(cq.getSGmt_Decay(), thirdinfohist.getGmtDecay(), "验证GmtDecay");
		Logger.verifyEquals(cq.getMobile(), thirdinfohist.getLoginMobile(), "验证LoginMobile");
		Logger.verifyEquals(cq.getTerminalSource().getCode(), thirdinfohist.getTerminalSource(), "验证TerminalSource");
		Logger.verifyEquals(cq.getSThirdParty(), thirdinfohist.getThirdParty(), "验证ThirdParty");
		Logger.verifyEquals(cq.getSAliUserId(), thirdinfohist.getThirdPartyId(), "验证ThirdPartyId");
		if(cq.getSRealName()==null){
			Logger.verifyIsContains(".alipay", thirdinfohist.getThirdPartyUserName(), "验证ThirdPartyUserName");
		}else{
			Logger.verifyEquals(cq.getSRealName(), thirdinfohist.getThirdPartyUserName(), "验证ThirdPartyUserName");
		}
		Logger.verifyEquals(cq.getSToken(), thirdinfohist.getThirdPartyToken(), "验证ThirdPartyToken");
		Logger.verifyEquals(cq.getSUserGradeType(), thirdinfohist.getUserGradeType(), "验证UserGradeType");
	}
	
//	1.第三方联合登入时传入新的第三方账号且传入手机号为新用户,注册第三方成功

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_001() {
		Logger.start(true,"ali账号第一次授权,创建用户成功");
		try {
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			String phone = TestDataManager.getPhoneNum();
			Logger.comment("绑定手机号，注册ali账号");
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("regAliUser_"+TestDataManager.getRandomNum(6));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setMobile(phone);
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregbean.setDeviceId(TestDataManager.getRandomUUID().toString());
			aliuserregbean.setEquimentid(TestDataManager.getRandomUUID().toString());
			aliuserregbean.setSGmt_Decay("SGmtTest");
			aliuserregbean.setSThirdParty("sThirdParty");
			aliuserregbean.setSToken("sToken");
			aliuserregbean.setSUserGradeType("GradeType");
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();	
			Logger.verifyEquals(ECode.SUCCESS, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
			Integer uid=aliuserregCall.getJsonObject().get("Result").getAsJsonObject().get("UserId").getAsInt();
			Logger.comment("和数据库进行数据校验");
			verifyDB(uid,aliuserregbean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
//	2.第三方联合登入时传入新的第三方账号且传入手机号为码头已存在用户,这个用户没有绑定过对应第三方账号,绑定成功
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_002() {
		Logger.start(true,"第三方联合登入时传入新的第三方账号且传入手机号为码头已存在用户,这个用户没有绑定过对应第三方账号,绑定成功");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			
			aliuserregbean.setMobile(cur.getMobile());
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			Logger.verifyEquals("login", aliuserregCall.getResult().get("Remark"), "验证Remark信息");
			Logger.verifyEquals(ECode.SUCCESS, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
			verifyDBBind(uid,aliuserregbean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
//	3.第三方联合登入时传入新的第三方账号且传入手机号为码头已存在用户,这个用户绑定过对应第三方账号,失败
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_003() {
		Logger.start(true,"第三方联合登入时传入新的第三方账号且传入手机号为码头已存在用户,这个用户绑定过对应第三方账号,失败");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			BindThirdPartyUserReq third=JUserCallService.initBindThirdUserReq(uid);
			third.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.bindThirdPartyUserCall(third);
			
			aliuserregbean.setMobile(cur.getMobile());
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			Logger.verifyIsContains("该手机号码已经绑定过支付宝账号", aliuserregCall.getString("LastErrorMessage"), "验证返回的LastErrorMessage信息");
			Logger.verifyEquals("400" ,aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("false", aliuserregCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

//	4.三方联合登入时传入已存在未解绑第三方账号,码头用户手机为空,来源为WAP,需要绑定手机
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_004() {
		Logger.start(true,"三方联合登入时传入已存在未解绑第三方账号,码头用户手机为空,来源为WAP,需要绑定手机");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			cur.setMobile(null);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			BindThirdPartyUserReq third=JUserCallService.initBindThirdUserReq(uid);
			third.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.bindThirdPartyUserCall(third);
			
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.Wap);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();	
			
			Logger.verifyIsContains("为了您的账户安全，请绑定你的手机号码", aliuserregCall.getString("LastErrorMessage"), "验证返回的LastErrorMessage信息");
			Logger.verifyEquals("400" ,aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("false", aliuserregCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
//	5.三方联合登入时传入已存在未解绑第三方账号,码头用户手机为空,来源为非WAP(app),登入成功
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_005() {
		Logger.start(true,"三方联合登入时传入已存在未解绑第三方账号,码头用户手机为空,来源为非WAP(app),登入成功");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			cur.setMobile(null);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			BindThirdPartyUserReq third=JUserCallService.initBindThirdUserReq(uid);
			third.setThirdPartyId(aliUserId);
			third.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.bindThirdPartyUserCall(third);
			
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			
			Logger.verifyIsContains("登录成功", aliuserregCall.getString("SuccessMessage"), "验证返回的SuccessMessage信息");
			Logger.verifyEquals("200" ,aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
//	6.三方联合登入时传入已存在未解绑第三方账号,码头用户手机和传入手机号一致,登入成功
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_006() {
		Logger.start(true,"三方联合登入时传入已存在未解绑第三方账号,码头用户手机和传入手机号一致,登入成功");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			BindThirdPartyUserReq third=JUserCallService.initBindThirdUserReq(uid);
			third.setThirdPartyId(aliUserId);
			third.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.bindThirdPartyUserCall(third);
			
			aliuserregbean.setMobile(cur.getMobile());
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			
			Logger.verifyIsContains("登录成功", aliuserregCall.getString("SuccessMessage"), "验证返回的SuccessMessage信息");
			Logger.verifyEquals("200" ,aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
//	7.三方联合登入时传入已存在未解绑第三方账号,码头用户手机为空,第三方传入新手机号,绑定登入成功
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_007() {
		Logger.start(true,"三方联合登入时传入已存在未解绑第三方账号,码头用户手机为空,第三方传入新手机号,绑定登入成功");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			cur.setMobile(null);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			BindThirdPartyUserReq third=JUserCallService.initBindThirdUserReq(uid);
			third.setThirdPartyId(aliUserId);
			third.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.bindThirdPartyUserCall(third);
			
			aliuserregbean.setMobile(TestDataManager.getPhoneNum());
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			
			Logger.verifyIsContains("登录成功", aliuserregCall.getString("SuccessMessage"), "验证返回的SuccessMessage信息");
			Logger.verifyEquals("200" ,aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
//	8.三方联合登入时传入已存在未解绑第三方账号,码头用户手机为空,第三方传入手机号是已存在码头用户,失败
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_008() {
		Logger.start(true,"三方联合登入时传入已存在未解绑第三方账号,码头用户手机为空,第三方传入手机号是已存在码头用户,失败");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			cur.setMobile(null);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			BindThirdPartyUserReq third=JUserCallService.initBindThirdUserReq(uid);
			third.setThirdPartyId(aliUserId);
			third.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.bindThirdPartyUserCall(third);
			
			CreateUserReq cur2 = new CreateUserReq();
			cur2 = JUserCallService.initCreateUserBean(cur2);
			 JUserCallService.createUserCall(cur2);
			
			aliuserregbean.setMobile(cur2.getMobile());
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			
			Logger.verifyIsContains("该手机号码已经绑定过码头账号了，换一个试试吧~", aliuserregCall.getString("LastErrorMessage"), "验证返回的LastErrorMessage信息");
			Logger.verifyEquals("400" ,aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("false", aliuserregCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
//	9.三方联合登入时传入已存在已解绑第三方账号,第三方手机号是新手机,注册登入成功
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_009() {
		Logger.start(true,"三方联合登入时传入已存在已解绑第三方账号,第三方手机号是新手机,注册登入成功");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			BindThirdPartyUserReq third=JUserCallService.initBindThirdUserReq(uid);
			third.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.bindThirdPartyUserCall(third);
			UnBindThirdPartyUserReq ubtrd=new UnBindThirdPartyUserReq();
			ubtrd.setThirdPartyId(third.getThirdPartyId());
			ubtrd.setUserId(uid);
			ubtrd.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.UnBindThirdPartyUserCall(ubtrd);
			
			aliuserregbean.setMobile(TestDataManager.getPhoneNum());
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();
			int nuid=aliuserregCall.getJsonObject().get("Result").getAsJsonObject().get("UserId").getAsInt();
			Logger.verifyEquals("new", aliuserregCall.getResult().get("Remark"), "验证Remark信息");
			Logger.verifyEquals(ECode.SUCCESS, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
			verifyDBBind(nuid,aliuserregbean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
//	10.三方联合登入时传入已存在已解绑第三方账号,第三方手机号是码头已存在未绑定第三方手机号,绑定成功
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_010() {
		//绑定解绑再绑定
		Logger.start(true,"三方联合登入时传入已存在已解绑第三方账号,第三方手机号是码头已存在未绑定第三方手机号,绑定成功");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			BindThirdPartyUserReq third=JUserCallService.initBindThirdUserReq(uid);
			third.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.bindThirdPartyUserCall(third);
			UnBindThirdPartyUserReq ubtrd=new UnBindThirdPartyUserReq();
			ubtrd.setThirdPartyId(third.getThirdPartyId());
			ubtrd.setUserId(uid);
			ubtrd.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.UnBindThirdPartyUserCall(ubtrd);
			
			aliuserregbean.setMobile(cur.getMobile());
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			Logger.verifyEquals("登录成功", aliuserregCall.getString("SuccessMessage"), "验证返回的Message信息");
			Logger.verifyEquals(ECode.SUCCESS, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
			verifyDBBind(uid,aliuserregbean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
//	11.三方联合登入时传入已存在已解绑第三方账号,第三方手机号是码头已存在已绑定第三方手机号,失败
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_011() {
		Logger.start(true,"三方联合登入时传入已存在已解绑第三方账号,第三方手机号是码头已存在已绑定第三方手机号,失败");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			BindThirdPartyUserReq third=JUserCallService.initBindThirdUserReq(uid);
			third.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.bindThirdPartyUserCall(third);
			UnBindThirdPartyUserReq ubtrd=new UnBindThirdPartyUserReq();
			ubtrd.setThirdPartyId(third.getThirdPartyId());
			ubtrd.setUserId(uid);
			ubtrd.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.UnBindThirdPartyUserCall(ubtrd);
			
			CreateUserReq cur2 = new CreateUserReq();
			cur2 = JUserCallService.initCreateUserBean(cur2);
			int uid2= JUserCallService.createUserCall(cur2);
			BindThirdPartyUserReq third2=JUserCallService.initBindThirdUserReq(uid2);
			third2.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			JUserCallService.bindThirdPartyUserCall(third2);
			
			
			aliuserregbean.setMobile(cur2.getMobile());
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			Logger.verifyIsContains("该手机号码已经绑定过支付宝账号了，换一个试试吧~", aliuserregCall.getString("LastErrorMessage"), "验证返回的LastErrorMessage信息");
			Logger.verifyEquals("400", aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("false", aliuserregCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
//	12.三方联合登入时传入已存在未解绑第三方账号,码头用户手机不为空第三方手机号为空,登入成功	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_012() {
		Logger.start(true,"三方联合登入时传入已存在未解绑第三方账号,码头用户手机不为空第三方手机号为空,登入成功");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			BindThirdPartyUserReq third=JUserCallService.initBindThirdUserReq(uid);
			third.setThirdPartyType(ThirdPartyTypeEnum.Alipay);
			third.setThirdPartyId(aliUserId);
			JUserCallService.bindThirdPartyUserCall(third);
			
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			
			Logger.verifyEquals("login", aliuserregCall.getResult().get("Remark"), "验证Remark信息");
			Logger.verifyEquals("200" ,aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_AliUserRequestDto_013() {
		Logger.start(false,"不输入Ali用户Id，用户创建失败");
		try {
			aliuserregbean.setSRealName("Lily");
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			Logger.verifyEquals("false", aliuserregCall.getString("Success"), "验证是否成功");
			Logger.verifyEquals(ECode.ERROR400, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyIsContains("错误的请求参数|无效的第三方用户Id", aliuserregCall.getString("LastErrorMessage"), "验证返回的Message信息");
			Logger.verifyEquals("IllegalArgument", aliuserregCall.getResult().get("VerifyCode"), "验证凭据");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_AliUserRequestDto_014(){
		Logger.start(true,"不输入真实用户名，用户创建成功");
		try {
			String aliUserId = TestDataManager.getRandomNum(7);
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSEmail(TestDataManager.getRandomNum(7)+"@Ali.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.Android);
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setIsNotReturnToken(true);
			aliuserregbean.setMobile(TestDataManager.getPhoneNum());
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();	
			int nuid=aliuserregCall.getJsonObject().get("Result").getAsJsonObject().get("UserId").getAsInt();
			Logger.verifyEquals("注册成功", aliuserregCall.getString("SuccessMessage"), "验证返回的Message信息");
			Logger.verifyEquals(ECode.SUCCESS, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
			
			
			Logger.verifyEquals("new", aliuserregCall.getResult().get("Remark"), "验证Remark信息");
			Logger.verifyEquals("Success", aliuserregCall.getResult().get("VerifyCode"), "验证凭据");
			verifyDB(nuid,aliuserregbean);
//			Logger.verifyEquals("登录ID不能为空", aliuserregCall.getString("LastErrorMessage"), "验证返回的Message信息");
//			Logger.verifyEquals(ECode.ERROR400, aliuserregCall.getString("ResponseCode"), "验证code");
//			Logger.verifyEquals("false", aliuserregCall.getString("Success"), "验证是否成功");
//			Logger.verifyEquals("LoginNameEmpty", aliuserregCall.getResult().get("VerifyCode"), "验证凭据");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_AliUserRequestDto_015(){
		Logger.start(false,"不输入手机，用户创建失败");
		try {
			String aliUserId = TestDataManager.getRandomNum(7);
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();	
			
			Logger.verifyEquals("为了您的账户安全，请绑定你的手机号码", aliuserregCall.getString("LastErrorMessage"), "验证返回的Message信息");
			Logger.verifyEquals(ECode.ERROR400, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("false", aliuserregCall.getString("Success"), "验证是否成功");
			Logger.verifyEquals("NeedBindMobile", aliuserregCall.getResult().get("VerifyCode"), "验证凭证");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_AliUserRequestDto_016() {
		Logger.start(true,"QQ账号第一次授权,创建用户成功,用户名长度大于20");
		try {
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			
			String phone = TestDataManager.getPhoneNum();
			
			Logger.comment("绑定手机号，注册QQ账号");
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("regAliUser_"+TestDataManager.getRandomNum(20));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setMobile(phone);
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			Logger.verifyEquals("new", aliuserregCall.getResult().get("Remark"), "验证Remark信息");
			Logger.verifyEquals(ECode.SUCCESS, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_AliUserRequestDto_017() {
		Logger.start(false,"QQ账号第一次授权,创建用户失败,用户名长度大于100");
		try {
			String aliUserId = "ali_"+TestDataManager.getRandomNum(101);
			
			String phone = TestDataManager.getPhoneNum();
			
			Logger.comment("绑定手机号，注册QQ账号");
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("regAliUser_"+TestDataManager.getRandomNum(101));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setMobile(phone);
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			String VerifyCode=aliuserregCall.getJsonObject().get("Result").getAsJsonObject().get("VerifyCode").getAsString();
			Logger.verifyEquals("LoginNameLengthError", VerifyCode, "验证返回的LoginNameLengthError信息");
			Logger.verifyEquals("400", aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("false", aliuserregCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_018() {
		Logger.start(true,"传入TokenSource为sellerapp用户注册成功JIRACONN-2123");
		try {
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			
			String phone = TestDataManager.getPhoneNum();
			
			Logger.comment("绑定手机号，注册QQ账号");
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("regAliUser_"+TestDataManager.getRandomNum(6));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setMobile(phone);
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregbean.setDeviceId(TestDataManager.getRandomUUID().toString());
			aliuserregbean.setEquimentid(TestDataManager.getRandomUUID().toString());
			aliuserregbean.setTokenSource("sellerapp");
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			Logger.verifyEquals("注册成功", aliuserregCall.getString("SuccessMessage"), "验证返回的Message信息");
			Logger.verifyEquals(ECode.SUCCESS, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_019() {
		Logger.start(true,"传入TokenSource为app用户注册成功JIRACONN-2123");
		try {
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			
			String phone = TestDataManager.getPhoneNum();
			
			Logger.comment("绑定手机号，注册QQ账号");
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("regAliUser_"+TestDataManager.getRandomNum(6));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setMobile(phone);
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregbean.setDeviceId(TestDataManager.getRandomUUID().toString());
			aliuserregbean.setEquimentid(TestDataManager.getRandomUUID().toString());
			aliuserregbean.setTokenSource("app");
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			Logger.verifyEquals("注册成功", aliuserregCall.getString("SuccessMessage"), "验证返回的Message信息");
			Logger.verifyEquals(ECode.SUCCESS, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_020() {
		Logger.start(false,"特殊字符用户名失败JIRACONN-2522");
		try {
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			
			String phone = TestDataManager.getPhoneNum();
			
			Logger.comment("绑定手机号，注册QQ账号");
			aliuserregbean.setSAliUserId(aliUserId+"!");
			aliuserregbean.setSRealName("~!@#$%^&*");
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setMobile(phone);
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregbean.setDeviceId(TestDataManager.getRandomUUID().toString());
			aliuserregbean.setEquimentid(TestDataManager.getRandomUUID().toString());
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			String VerifyCode=aliuserregCall.getJsonObject().get("Result").getAsJsonObject().get("VerifyCode").getAsString();
			Logger.verifyEquals("LoginNameContainSQLSensitiveCode", VerifyCode, "验证返回的LoginNameContextError信息");
			Logger.verifyEquals(ECode.ERROR400, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("false", aliuserregCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_021() {
		Logger.start(true,"第三方账号已存在，App");
		try {
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			String phone = TestDataManager.getPhoneNum();   
			Logger.comment("绑定手机号，注册QQ账号");
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("regAliUser_"+TestDataManager.getRandomNum(6));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setMobile(phone);
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregbean.setDeviceId(TestDataManager.getRandomUUID().toString());
			aliuserregbean.setEquimentid(TestDataManager.getRandomUUID().toString());
			aliuserregbean.setSGmt_Decay("SGmtTest");
			aliuserregbean.setSThirdParty("sThirdParty");
			aliuserregbean.setSToken("sToken");
			aliuserregbean.setSUserGradeType("GradeType");
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();	
			Logger.verifyEquals(ECode.SUCCESS, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
			
			aliuserregbean.setRegSource(AppSourceEnum.Wap);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();	
			
			Logger.verifyEquals(ECode.SUCCESS, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
			Integer uid=aliuserregCall.getJsonObject().get("Result").getAsJsonObject().get("UserId").getAsInt();
			Logger.comment("和数据库进行数据校验");

			aliuserregbean.setRegSource(AppSourceEnum.App);
			verifyDB(uid,aliuserregbean);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_022() {
		Logger.start(true,"ali注册成功后删除账号手机，然后换渠道带手机号联登,成功,手机入库");
		try {
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			String phone = TestDataManager.getPhoneNum();
			Logger.comment("绑定手机号，注册ali账号");
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("regAliUser_"+TestDataManager.getRandomNum(6));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setMobile(phone);
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregbean.setDeviceId(TestDataManager.getRandomUUID().toString());
			aliuserregbean.setEquimentid(TestDataManager.getRandomUUID().toString());
			aliuserregbean.setSGmt_Decay("SGmtTest");
			aliuserregbean.setSThirdParty("sThirdParty");
			aliuserregbean.setSToken("sToken");
			aliuserregbean.setSUserGradeType("GradeType");
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();	
			Logger.verifyEquals(ECode.SUCCESS, aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("true", aliuserregCall.getString("Success"), "验证是否成功");
			Integer uid=aliuserregCall.getJsonObject().get("Result").getAsJsonObject().get("UserId").getAsInt();
			new JUserWapper().removeMoblie(uid);
			
			aliuserregbean.setRegSource(AppSourceEnum.Wap);
			aliuserregCall.callService();	
			//阿里渠道号不变
			aliuserregbean.setRegSource(AppSourceEnum.App);
			Logger.comment("和数据库进行数据校验");
			verifyDB(uid,aliuserregbean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	//TODO 锁定账号 注销账号 不能第三方绑定
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_023() {
		Logger.start(true,"第三方联合登入时绑定已存在锁定账号,绑定失败,登入失败JIRACONN-9521");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			JUserCallService.lockUsers(uid);
			aliuserregbean.setMobile(cur.getMobile());
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			Logger.verifyEquals("UserLocked", aliuserregCall.getResult().get("VerifyCode"), "验证VerifyCode信息");
			Logger.verifyEquals("400", aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("false", aliuserregCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_AliUserRequestDto_024() {
		Logger.start(true,"第三方联合登入时绑定已存在注销账号,绑定失败,登入失败JIRACONN-9521");
		try {
			CreateUserReq cur = new CreateUserReq();
			cur = JUserCallService.initCreateUserBean(cur);
			int uid = JUserCallService.createUserCall(cur);
			String aliUserId = "ali_"+TestDataManager.getRandomNum(10);
			new JUserWapper().updateUserState(uid, 2);
			aliuserregbean.setMobile(cur.getMobile());
			aliuserregbean.setSAliUserId(aliUserId);
			aliuserregbean.setSRealName("Lily"+TestDataManager.getRandomNum(10));
			aliuserregbean.setSEmail("12456@123.com");
			aliuserregbean.setRegSource(AppSourceEnum.App);
			aliuserregbean.setTerminalSource(TerminalSourceEnum.IOS);
			aliuserregbean.setClientIp("120.1.1.1");
			aliuserregbean.setTokenTimeOut((new Date()).getTime());
			aliuserregbean.setAppTypeChanndel(AppTypeChannel.NEW_CHANNEL);
			aliuserregCall.setData(aliuserregbean);
			aliuserregCall.callService();			
			Logger.verifyEquals("UserLocked", aliuserregCall.getResult().get("VerifyCode"), "验证VerifyCode信息");
			Logger.verifyEquals("400", aliuserregCall.getString("ResponseCode"), "验证code");
			Logger.verifyEquals("false", aliuserregCall.getString("Success"), "验证是否成功");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}